<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Tymon\JWTAuth\Facades\JWTAuth;

class UserController extends Controller
{
    public function index()
    {
//        return JWTAuth::getToken();
        //如果用户没有登录，则不返回数据
        $user = JWTAuth::parseToken()->authenticate();
//         return $user;

        //可以在roles()后面进行链式调用
        //$users = \App\User::find(1)->roles()->orderBy('name')->get();
        return $user;
    }
}
